<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\ArrayHelper;

$all_columns = ArrayHelper::getColumn($columns, 'attribute');
ArrayHelper::remove($all_columns, 0);
ArrayHelper::remove($all_columns, count($all_columns));
$right_columns = [];
$attributeLabels = $model->attributeLabels();
foreach ($all_columns as $item) {
    $right_columns[$item] = $attributeLabels[$item];
}
?>
<div class="row">
    <div class="col-sm-offset-1 col-sm-11">
        <?php $form = ActiveForm::begin(['layout' => 'horizontal','method'=>'GET','action'=>['/project-ease/index']]); ?>

        <?= $form->field($model, 'columns', ['template' => "{label}\n{input}\n{hint}\n{error}", 'labelOptions' => ['class' => 'control-label']])->checkboxList($right_columns, ['class' => 'form-inline'])->label('请选择要展示的列名：') ?>
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <?= Html::submitButton('提交', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
                </div>
            </div>
        </div>

        <?php ActiveForm::end(); ?>
    </div>
</div>


